<?php

namespace App\Http\Requests\Frontend\V10\Financial;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class loanRequestApplyRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
//            'loan_money'=>'required|integer',
            'bank_card_id'=>'required|integer',
            'period'=>'required|integer',
            'use'=>['required',Rule::in(['01','02','03','04','05','06','07','08'])],
        ];
    }

    public function messages()
    {
        return [
//            'loan_money.required'=>'借款金额不能为空',
//            'loan_money.integer'=>'借款金额异常',
            'bank_card_id.required'=>'银行卡信息必填',
            'bank_card_id.integer'=>'银行卡信息异常',
            'period.required'=>'借款期数不能为空',
            'period.integer'=>'借款期数异常',
            'use.required'=>'借款用途不能为空',
            'use.in'=>'借款用途不在可用范围内',
        ];
    }
}
